<template>
  <div class="notFound">
    <!-- 页面未找到的图片部分 -->
    <div class="notFound-img">
      <!-- 主404图片 -->
      <img src="@/assets/image/404.png" alt="404" />

      <!-- 左侧的云朵图标 -->
      <img class="notFound-img-child left" src="@/assets/image/404_cloud.png" alt="404" />

      <!-- 中间的云朵图标 -->
      <img class="notFound-img-child mid" src="@/assets/image/404_cloud.png" alt="404" />

      <!-- 右侧的云朵图标 -->
      <img class="notFound-img-child right" src="@/assets/image/404_cloud.png" alt="404" />
    </div>

    <!-- 页面提示文本部分 -->
    <div class="text">
      <h2>页面没有找到</h2>
      <p>很抱歉，您访问的页面不存在！</p>
      <el-button type="text" @click="goBack">返回上一页</el-button>
      <el-button v-if="isLogin" type="text" @click="goHome">
        返回首页
      </el-button>
    </div>
  </div>
</template>

<script>
export default {
  computed: {
    /**
     * TODO: 判断是否登录
     * @returns {Boolean}
     */
    isLogin() {
      return true;
    },
  },
  methods: {
    /**
     * 返回上一页
     * @returns {void}
     */
    goBack() {
      this.$router.back(-1);
    },

    /**
     * 返回首页
     * @returns {void}
     */
    goHome() {
      this.$router.push('/');
    }
  },
};
</script>

<style lang="scss" scoped>
@import url('@/assets/scss/error.scss');
</style>
